﻿using System;
using System.Web;
using ASPNETVN.PORTAL.Modules.ACTP.Components;

namespace ASPNETVN.PORTAL.Modules.ACTP.Controls
{
    public partial class EmployeeDetailControl : System.Web.UI.UserControl
    {

        private int _EmplopyeeID;
        public int EmplopyeeID
        {
            get
            {
                if (_EmplopyeeID == 0)
                {
                    if (HttpContext.Current != null && Request.Params["EmplopyeeID"] != null)
                        _EmplopyeeID = Int32.Parse(Request.Params["EmplopyeeID"]);
                }
                return _EmplopyeeID;
            }
            set { _EmplopyeeID = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack ==false)
            {
                Employee employee = Employee.Load(this.EmplopyeeID);
                LabelCode.Text = employee.EmployeeCode;
                LabelPersonalTitle.Text = employee.PersonalTitle;
                LabelFullname.Text = employee.FirstName + ", " + employee.LastName;
                LabelGender.Text = employee.Gender ? "Male" : "Female";
            }
        }
    }
}